package com.pub.sort;

import com.pub.util.WordUtils;


public class SortWordsCount implements Comparable<SortWordsCount>
{
	private String strCompareStr;
	
	public SortWordsCount(String strCompareStrParam)
	{
		this.strCompareStr = strCompareStrParam;
	}
	
	public String strGetCompareStr()
	{
		return this.strCompareStr;
	}
	
	public int compareTo(SortWordsCount obData) {
		String strCache = obData.strCompareStr;
		
		int iWordCount 		= WordUtils.iGetWordCountWithChar(strCache);
		int iSelfWordCount 	= WordUtils.iGetWordCountWithChar(this.strCompareStr);
		
		if(iSelfWordCount > iWordCount)
			return 1;
		else if (iSelfWordCount < iWordCount)
			return -1;
		else
			return 0;
	}
}